/**
 * Created by Administrator on 2017\9\22 0022.
 */
import React from 'react';
import {Link} from 'react-router-dom';
import { Row,Col,Checkbox} from 'antd';
import template from './../../commonui/template';

const CheckboxGroup = Checkbox.Group;

var defaultCheckList1 =['Apple','Pear','Orange'];
var plainOptions1 =['Apple','Pear','Orange'];

class PlatChk extends React.Component{
    constructor(props){
        super(props);
        this.state={
            checkedList:defaultCheckList1,
            indeterminate:true,
            checkAll:false
        }
        this.handlechange=this.handlechange.bind(this);
        this.onCheckAllChange=this.onCheckAllChange.bind(this);
    }
    handlechange(checkedList){
        this.setState({
            checkedList,
            indeterminate:!!checkedList.length&&(checkedList.length<plainOptions1.length),
            checkAll:checkedList.length===plainOptions.length,
        });
    }
    onCheckAllChange(e){
        this.setState({
            checkedList:e.target.checked?plainOptions1:[],
            indeteminate:false,
            checkAll:e.target.checked
        })
    }
    render(){
        return (
            <div>
                <div style={{borderBottom:'1px solid #E9e9E9'}}>
                  {/*<Checkbox
                        indeterminate={this.state.indeterminate}
                        onChange={this.onCheckAllChange}
                        checked={this.state.checkAll}
                    >
                        Fruite
                    </Checkbox>
                    <br/>
                   <CheckboxGroup options={plainOptions1} value={this.state.checkedList} onChange={this.handlechange}/>*/}
                </div>
            </div>
        )
    }
}





export default template({
    id: 'CheckList',
    component: PlatChk
});